package com.asset.dispoal.dataDetail.service;

import com.asset.dispoal.dataDetail.api.SysDataDetailService;
import com.asset.dispoal.dataDetail.dto.SysDataDetailRequest;
import com.asset.dispoal.dataDetail.dto.SysDataDetailResponse;
import com.asset.dispoal.dataDetail.dto.SysDataDetailTemplateRequest;
import com.asset.dispoal.dataDetail.dto.SysDataDetailTemplateResponse;
import com.asset.dispoal.dataDetail.service.commom.DataDetailDeleteCommand;
import com.asset.dispoal.dataDetail.service.commom.DataDetailInsertCommand;
import com.asset.dispoal.dataDetail.service.commom.DataDetailQueryPageCommand;
import com.asset.dispoal.dataDetail.service.commom.DataDetailTemplateQueryPageCommand;
import com.asset.dispoal.dataDetail.service.commom.DataDetailUpdateCommand;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tech.mhuang.pacebox.springboot.protocol.Result;
import tech.mhuang.pacebox.springboot.protocol.data.PageVO;

/**
 * 数据清单表服务实现类
 *
 * @author: mhuang
 * @date: 2022-03-23 13:47:06
 */
@Service
public class SysDataDetailServiceImpl implements SysDataDetailService {


    @Autowired
    DataDetailDeleteCommand dataDetailDeleteCommand;

    @Autowired
    DataDetailInsertCommand dataDetailInsertCommand;

    @Autowired
    DataDetailUpdateCommand dataDetailUpdateCommand;

    @Autowired
    DataDetailQueryPageCommand dataDetailQueryPageCommand;
    @Autowired
    DataDetailTemplateQueryPageCommand dataDetailTemplateQueryPageCommand;

    @Override
    public void insert(SysDataDetailRequest request) {
        dataDetailInsertCommand.execute(request);
    }

    @Override
    public void update(SysDataDetailRequest request) {
        dataDetailUpdateCommand.execute(request);
    }

    @Override
    public void delete(String id) {
        dataDetailDeleteCommand.execute(id);
    }

    @Override
    public Result<PageVO<SysDataDetailResponse>> queryPage(SysDataDetailRequest request) {
        return dataDetailQueryPageCommand.execute(request);
    }

    @Override
    public Result<PageVO<SysDataDetailTemplateResponse>> queryTemplatePage(SysDataDetailTemplateRequest request) {
        return dataDetailTemplateQueryPageCommand.execute(request);
    }
}